package com.plugIn;

import android.app.Activity;
import android.content.Intent;

import com.Ad.AdActivity;
import com.unity3d.player.UnityPlayer;

public class TestShowAd {
    public static Activity activity = null;

    public static Activity getActivity() {
        if (activity == null) {
            activity = UnityPlayer.currentActivity;
        }
        return activity;
    }

    public static void ShowAd() {
        Intent intent = new Intent(getActivity(), AdActivity.class); // 第一个参数是当前 Activity 的上下文，第二个参数是要启动的 Activity 类
        getActivity().startActivity(intent);
    }
}
